package com.chuantou.yuba.api.to;

import com.google.gson.annotations.SerializedName;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 列表资讯信息
 * 
 * @author Administrator
 * 
 */
public class NewsTO implements Parcelable {
	@SerializedName("id")
	private long id;
	@SerializedName("title")
	private String title;
	@SerializedName("source")
	private String source;
	@SerializedName("dateline")
	private long publishTime;
	@SerializedName("img")
	private String image;
	@SerializedName("reply_total")
	private int replyCount;
	@SerializedName("summary")
	private String subTitle;

	public NewsTO() {
	}

	public NewsTO(Parcel source) {
		this.id = source.readLong();
		this.title = source.readString();
		this.source = source.readString();
		this.publishTime = source.readLong();
		this.image = source.readString();
		this.replyCount = source.readInt();
		this.subTitle = source.readString();
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeLong(this.id);
		dest.writeString(this.title);
		dest.writeString(this.source);
		dest.writeLong(this.publishTime);
		dest.writeString(image);
		dest.writeInt(replyCount);
		dest.writeString(subTitle);
	}

	public static final Creator<NewsTO> CREATOR = new Creator<NewsTO>() {

		@Override
		public NewsTO[] newArray(int size) {
			return new NewsTO[size];
		}

		@Override
		public NewsTO createFromParcel(Parcel source) {
			return new NewsTO(source);
		}
	};

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public long getPublishTime() {
		return publishTime;
	}

	public void setPublishTime(long publishTime) {
		this.publishTime = publishTime;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public int getReplyCount() {
		return replyCount;
	}

	public void setReplyCount(int replyCount) {
		this.replyCount = replyCount;
	}

	public String getSubTitle() {
		return subTitle;
	}

	public void setSubTitle(String subTitle) {
		this.subTitle = subTitle;
	}

	@Override
	public boolean equals(Object o) {
		if (o == null || !(o instanceof NewsTO))
			return false;
		NewsTO other = (NewsTO) o;
		return this.id == other.getId();
	}
}
